#!/bin/sh

cur_dir=$(cd `dirname $0`;pwd)
plugin_dir=~/.tmux/plugins
tpm_dir=$plugin_dir/tpm
conf_file=$cur_dir/tmux.conf
ln_file=~/.tmux.conf

if [ ! -e $plugin_dir ]; then
    mkdir -p $plugin_dir
fi

if [ ! -e $tpm_dir ]; then
    echo '开始下载 tpm'
    git clone https://github.com/tmux-plugins/tpm $tpm_dir
fi

if [ -e $ln_file ]; then
    rm $ln_file
fi
ln -s $conf_file $ln_file

echo '初始化完成，现在你需要执行：'
echo "tmux source $ln_file"
